Repository navigation
fix: Clear empty FDv2 selectors in shared protocol handling - #261
Merged
Merged
Conversation
Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
There was a problem hiding this comment.
Risk: low.
Automated risk review (dry run): Low
This PR would be automatically approved.
Why: A one-line change in FDv2ProtocolHandler maps empty FDv2 payload state to Selector.EMPTY, with new tests in the shared handler and server poll/stream paths. Bugbot completed with no findings, and this is not infra, auth, or policy configuration.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver
joker23
approved these changes
Nov 18, 2026
keelerm84
approved these changes
Nov 18, 2026
This was referenced Nov 18, 2026
kinyoklion
pushed a commit
that referenced
this pull request
Nov 18, 2026
🤖 I have created a release *beep* *boop* --- ## [1.13.0](launchdarkly-java-sdk-internal-1.12.2...launchdarkly-java-sdk-internal-1.13.0) (2026-11-18) ### Features * Parse protocolFallbackTTL from FDv2 goodbye ([#265](#265)) ([72d0fe1](72d0fe1)) ### Bug Fixes * Clear empty FDv2 selectors in shared protocol handling ([#261](#261)) ([576b081](576b081)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Release Please** cuts **`lib/shared/internal`** from **1.12.2** to **1.13.0**, updating `.release-please-manifest.json`, `gradle.properties`, and `CHANGELOG.md` only. > > The published **1.13.0** notes add **FDv2 goodbye** support for parsing **`protocolFallbackTTL`** (including malformed/null handling via `Goodbye`) and a fix to **clear empty FDv2 selectors** in shared protocol handling so empty selector state does not linger incorrectly. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4ca3c46. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 of 3 tasks
kinyoklion
added a commit
that referenced
this pull request
Nov 19, 2026
**Requirements** - [ ] I have added test coverage for new or changed functionality - [x] I have followed the repository's [pull request submission guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests) - [ ] I have validated my changes against all supported platform versions **Related issues** - #261: the selectorless FDv2 fix in the shared internal module, released in 1.13.0 - launchdarkly/sdk-test-harness#600: contract tests for FDv2 payloads without a selector **Describe the solution you've provided** Bumps `launchdarklyJavaSdkInternal` in `lib/sdk/server/build.gradle` from 1.12.2 to 1.13.0. With 1.12.2, a full transfer with an empty `state` produced a non-empty selector, so the server SDK sent `basis` on its next request. **Describe alternatives you've considered** #257 also bumps to 1.13.0, but its cooldown changes will ship in a later internal version. **Additional context** Local results on Java 8: - `./gradlew test` in `lib/sdk/server`: 1987 tests, 0 failures. - sdk-test-harness#600, `streaming/fdv2/payloads without a selector`: 5/5 pass. 3 of the 5 fail on main. - Full v3 contract suite with the CI suppression file and persistence tests: 6311 ran, all passed. Link to Devin session: https://app.devin.ai/sessions/fa07e76e6e3346c9b26f2eae4ff6694b Open in Devin Desktop: https://app.devin.ai/desktop/session/fa07e76e6e3346c9b26f2eae4ff6694b?variant=devin Requested by: @kinyoklion <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Bumps **`launchdarklyJavaSdkInternal`** in `lib/sdk/server/build.gradle` from **1.12.2** to **1.13.0**, pulling in the shared internal fix for **selectorless FDv2** payloads (issue #261). > > Previously, a full transfer with an empty `state` could still yield a non-empty selector, so the server SDK incorrectly sent **`basis`** on the following streaming request. Contract tests for payloads without a selector are expected to pass after this upgrade. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 703704e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 of 3 tasks
kinyoklion
added a commit
to launchdarkly/android-client-sdk
that referenced
this pull request
Nov 19, 2026
**Requirements** - [ ] I have added test coverage for new or changed functionality - [x] I have followed the repository's [pull request submission guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests) - [ ] I have validated my changes against all supported platform versions **Related issues** - launchdarkly/java-core#261: the selectorless FDv2 fix in the shared internal module, released in 1.13.0 - launchdarkly/java-core#273: removes `java.time.Duration` from FDv2 goodbye parsing (API 26+ only), released in 1.13.1 - launchdarkly/sdk-test-harness#600: contract tests for FDv2 payloads without a selector **Describe the solution you've provided** Bumps `launchdarklyJavaSdkInternal` from 1.9.0 to 1.13.1 in `launchdarkly-android-client-sdk/build.gradle` and `shared-test-code/build.gradle`. With 1.9.0, a full transfer with an empty `state` produced a non-empty selector, so the SDK sent `basis` on its next request. 1.13.1 also avoids the 1.13.0 `java.time.Duration` call when parsing an FDv2 goodbye with `protocolFallbackTTL`, which is unavailable below API 26 without desugaring. No API changes were needed. **Describe alternatives you've considered** Stopping at 1.13.0, which would introduce the `Duration` use on API 21–25. **Additional context** Local results on Java 17 with an API 25 emulator, run against 1.13.0: - `./gradlew build jar`: 752 unit tests in each of debug and release, 0 failures. - sdk-test-harness#600, `streaming/fdv2/payloads without a selector`: 5/5 pass. 3 of the 5 fail on main. - Full v3 contract suite with the CI-pinned harness (v3.2.0-alpha.10) and `testharness-suppressions-fdv2.txt`: 895 ran, all passed. 1.13.1 was released minutes before this update and may not be on Maven Central yet; rerun CI if dependency resolution fails. Link to Devin session: https://app.devin.ai/sessions/2540f086f1ea4dfba1470051465fb0fd Open in Devin Desktop: https://app.devin.ai/desktop/session/2540f086f1ea4dfba1470051465fb0fd?variant=devin Requested by: @kinyoklion <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Bumps **`launchdarklyJavaSdkInternal`** from **1.9.0** to **1.13.1** in **`launchdarkly-android-client-sdk/build.gradle`** and **`shared-test-code/build.gradle`**. > > This pulls in shared-internal fixes for **FDv2 full transfers with empty `state`**, which previously caused an incorrect non-empty selector and extra **`basis`** requests, and picks **1.13.1** over 1.13.0 so **FDv2 goodbye** parsing avoids **`java.time.Duration`** (API 26+) on **API 21–25** without desugaring. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7e9b48e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
kinyoklion
pushed a commit
that referenced
this pull request
Nov 20, 2026
🤖 I have created a release *beep* *boop* --- ## [7.18.2](launchdarkly-java-server-sdk-7.18.1...launchdarkly-java-server-sdk-7.18.2) (2026-11-20) ### Bug Fixes * Clear empty FDv2 selectors in shared protocol handling ([#261](#261)) ([576b081](576b081)) * Prevent flags in a persistent store from becoming available to mobile keys ([#275](#275)) ([32c8676](32c8676)) * Treat a null optional property in flag data as omitted ([#268](#268)) ([3af465d](3af465d)) * Update launchdarkly-java-sdk-internal to 1.13.0 ([#272](#272)) ([9cc5885](9cc5885)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > This **release PR** bumps the LaunchDarkly Java server SDK from **7.18.1** to **7.18.2** across Release Please metadata (`gradle.properties`, `Version.SDK_VERSION`, and `.release-please-manifest.json`). > > The new **CHANGELOG** section records the fixes shipped in this patch: clearing empty FDv2 selectors in shared protocol handling, blocking persistent-store flags from being exposed to mobile keys, treating null optional flag properties as omitted, and updating `launchdarkly-java-sdk-internal` to 1.13.0. Those behavioral changes are not part of this diff—only the version and release notes are updated here. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 9087581. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Requirements
Related issues
launchdarkly/ld-relay#979 sends FDv2 full transfers with no selector (
payload-transferred {"state":"","version":0}). The sharedFDv2ProtocolHandlerbuiltSelector.make(0, "")from it, and that selector is not empty. As a result, the server SDK and Android sent an emptybasis=on later polls and stream reconnects. The contract test for this is launchdarkly/sdk-test-harness#600.Describe the solution you've provided
FDv2ProtocolHandler(shared internal): an empty transferredstatenow becomesSelector.EMPTY. The existing store assignment then clears the held selector. The server polling and streaming requests already checkisEmpty(), so they leave outbasis.basisonce the selector is empty.Android uses this shared handler. It needs an internal dependency bump after release (it currently pins 1.9.0). The Java server SDK pins 1.12.2.
Describe alternatives you've considered
Guarding each request builder against an empty state. Normalizing once in the shared handler fixes server and Android in one place.
Additional context
I couldn't verify this locally. Maven Central returned HTTP 429 during Gradle dependency resolution, so tests, Checkstyle, and the selectorless contract group did not run. CI is the first real check.
Link to Devin session: https://app.devin.ai/sessions/f3b22e19bdde48f1b39f77808077390b
Open in Devin Desktop: https://app.devin.ai/desktop/session/f3b22e19bdde48f1b39f77808077390b?variant=devin
Requested by: @kinyoklion
Note
Overview
Fixes FDv2 clients sending an invalid
basis=query after a selectorless full transfer (payload-transferredwith emptystate).Shared protocol:
FDv2ProtocolHandlernow maps an empty transferredstatetoSelector.EMPTYinstead ofSelector.make(version, ""), which was still treated as non-empty and caused later polls/stream connects to includebasis=.Tests: Shared handler cases for selectorless full transfers and version-0 state with a non-empty id; server tests assert polling and streaming omit
basiswhen the held selector is empty. Normal selector-bearing transfers are unchanged.Reviewed by Cursor Bugbot for commit 6b4d555. Bugbot is set up for automated code reviews on this repo. Configure here.